/*
** kill_client.c for Kill in /home/vriely/Dropbox/work/Unix/Zappy_rendu/serv-src
**
** Made by Samuel Vrielynck
** Login   <vriely_s@epitech.net>
**
** Started on  Fri Jul 13 12:27:26 2012 Samuel Vrielynck
** Last update Thu Jul 19 17:48:39 2012 pierrick druart
*/

#include		"server.h"

struct s_item		*kill_client(t_list *clients, t_client *client,
    t_game *game, t_item *cur)
{
  xclose(client->sock);
  if (client == game->graphic)
    game->graphic = NULL;
  if (client->gamer != NULL)
  {
    client->gamer->team->check_slot(client->gamer->team, game->nb_player);
    game->obj[client->gamer->coord.y][client->gamer->coord.x].inv[JOUEUR]--;
  }
  return (clients->erase(clients, cur, &erase_client));
}
